/***********************************************************
 * Author: 	Brandon McKune
 * E-Mail:	bmckune.cs@gmail.com
 * Date:	September 2, 2011
 * Class:	CSc 8370 - Data Security
 * Time:	1150 - 1325
 * Smstr:	Fall 2011
 */

#ifndef STATISTICS_HANDLER_H_
#define STATISTICS_HANDLER_H_

#include <cctype>
#include <ctype.h>
#include "common.h"
#include <string>
#include <map>
#include <math.h>

struct SCharFrequency{
	char s_cChars;
	UINT s_i64Size;
	double s_dFrequency;
};

using namespace std;

class StatisticsHandler{
public:
	StatisticsHandler();
	~StatisticsHandler();
	bool loadCharBuffer(char* buffer, size_t size);
	double getFrequency(char* target, size_t size);
	double getPsi(UINT numChar);
	double getPhi(UINT numChar);
protected:
	bool pullCharacterSet(UINT numChars);
	bool validateInput(void* buffer, size_t size);
	bool preRequirements();
private:
	UINT m_ui64BufferSize;
	char* m_prgCharBuffer;
	map<string,double> *m_pSuCharSet;
};

#endif
